﻿namespace TG
{
    public class TransportCase : EntityBase
    {
        public TransportCaseType transportCaseType;
        public override MapItemType mapItemType => MapItemType.TransportCase;

        public void Init(MapCell mapCell, TransportCaseType transportCaseType)
        {
            base.Init(mapCell);
            this.transportCaseType = transportCaseType;
        }

        protected override void Trigger(EntityBase entity)
        {
            base.Trigger(entity);
            switch (transportCaseType)
            {
                case TransportCaseType.None:
                    break;
                case TransportCaseType.CabbageBox:
                    GameManager.Instance.GetGameData().EatEntity(MapItemType.Cabbage, 5);
                    break;
                case TransportCaseType.PeachBox:
                    GameManager.Instance.GetGameData().EatEntity(MapItemType.Peach, 5);
                    break;
            }

            RemoveSelf();
        }
    }
}